package ArryProTest;

public class Test05 {
    public static void main(String[] args) {
        //ORM Objesct relationship mopping 对象映射
        //  Object[] emp2 = {1002,"许二涛",16,"程序猿","2019-09-09"};
        Emp emp0 = new Emp(1001,"许涛涛",18,"程序猿","2019-9-9");
        Emp emp1 = new Emp(1002,"许一涛",19,"程序猿","2019-1-9");
        Emp emp2 = new Emp(1003,"许二涛",13,"程序猿","2019-9-9");

//        Emp[] emps = {emp0,emp1,emp2};
        Emp[] emps = new Emp[3];
        emps[0] = emp0;
        emps[1] = emp2;
        emps[2] = emp1;
        //遍历数组
        for (int i = 0; i < emps.length; i++) {
        System.out.println(emps[i]);
    }
}
}
class Emp{
    public Emp(){

    }
    public Emp(int id, String name, int age, String job, String hiredate) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.job = job;
        this.hiredate = hiredate;
    }

    @Override
    public String toString() {
        return getId()+"\t"+getName()+"\t"+getAge()+"\t"+getJob()+"\t"+getHiredate();
    }

    private int id;
    private String name;
    private int age;
    private String job;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age+"岁";
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public String getHiredate() {
        return hiredate;
    }

    public void setHiredate(String hiredate) {
        this.hiredate = hiredate;
    }

    private String hiredate;


}
